<template>
  <div class="app">
    <h1>我是App组件</h1>
    <Child :sendToy="getToy"/>
  </div>
</template>

<script>
  import Child from './components/Child'

  export default {
    name:'App',
    components:{Child},
    methods: {
      getToy(value){
        alert(`我是App，我儿子孝顺给了我一个玩具：${value}`)
      }
    },
  }
</script>

<style>
  .app {
    background-color: skyblue;
    padding: 20px;
    box-shadow: 0 0 10px black;
    border-radius: 10px;
  }
</style>